#include <string>
#include "Array2Tree.cpp"
#include <iostream>
using namespace std;

ostream& operator<<(ostream& out, TreeNode<int> t)
{
	out << t.getNode();
	return out;
}

void filterfun(const TreeNode<int> t)
{
	cout << t << " ";
}

int main(int argc, char* argv[])
{
	int array[] = { 1, 23, 14, 12, 43, 108, 78, 83, 61, 23 };

	int arraySize = sizeof(array) / sizeof(array[0]);

	Array2Tree<int> tree(arraySize);
	tree.setFilterFun(filterfun);

	for(auto x : array)
	{
		tree.insert(x);
	}

	const TreeNode<int>* t = tree.getArray();
	int length = tree.getinUse();

	for(int i=0; i<9; i++)
    {
     //  cout<<t[i].getNode()<<" ";
    }

	//tree.oneByone();
	cout << "done\n";
	getchar();
	return 0;
}

